<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:forgeview="http://jboss.org/forge/view"	
	template="/resources/scaffold/pageTemplate.xhtml">

	<f:metadata>
		<f:viewParam name="id" value="#{sysOrgBean.id}"/>
		<f:event type="preRenderView" listener="#{sysOrgBean.retrieve}"/>
	</f:metadata>

	<ui:param name="pageTitle" value="Create Sys Org"/>

	<ui:define name="header">
		Sys Org
	</ui:define>

	<ui:define name="subheader">
		<c:choose>
			<c:when test="#{!empty sysOrgBean.id}">
				Edit existing Sys Org
			</c:when>
			<c:otherwise>
				Create a new Sys Org
			</c:otherwise>
		</c:choose>
	</ui:define>

	<ui:define name="footer"/>

	<ui:define name="main">
		<h:form id="create">
			<h:messages globalOnly="true" styleClass="error"/>

			<h:panelGrid columnClasses="label,component,required" columns="3">
				<h:outputLabel for="sysOrgBeanSysOrgOrgNo" value="Org No:"/>
				<h:panelGroup>
					<h:inputText id="sysOrgBeanSysOrgOrgNo" required="true" value="#{sysOrgBean.sysOrg.orgNo}"/>
					<h:message for="sysOrgBeanSysOrgOrgNo" styleClass="error"/>
				</h:panelGroup>
				<h:outputText value="*"/>
				<h:outputLabel for="sysOrgBeanSysOrgSysOrgType" value="Sys Org Type:"/>
				<h:panelGroup>
					<h:selectOneMenu converter="#{sysOrgTypeBean.converter}" id="sysOrgBeanSysOrgSysOrgType" value="#{sysOrgBean.sysOrg.sysOrgType}">
						<f:selectItem/>
						<f:selectItems itemLabel="#{forgeview:display(_item)}" itemValue="#{_item}" value="#{sysOrgTypeBean.all}" var="_item"/>
					</h:selectOneMenu>
					<h:message for="sysOrgBeanSysOrgSysOrgType" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysOrgBeanSysOrgSysCompany" value="Sys Company:"/>
				<h:panelGroup>
					<h:selectOneMenu converter="#{sysCompanyBean.converter}" id="sysOrgBeanSysOrgSysCompany" value="#{sysOrgBean.sysOrg.sysCompany}">
						<f:selectItem/>
						<f:selectItems itemLabel="#{forgeview:display(_item)}" itemValue="#{_item}" value="#{sysCompanyBean.all}" var="_item"/>
					</h:selectOneMenu>
					<h:message for="sysOrgBeanSysOrgSysCompany" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysOrgBeanSysOrgOrgCode" value="Org Code:"/>
				<h:panelGroup>
					<h:inputText id="sysOrgBeanSysOrgOrgCode" maxLength="50" value="#{sysOrgBean.sysOrg.orgCode}"/>
					<h:message for="sysOrgBeanSysOrgOrgCode" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysOrgBeanSysOrgOrgName" value="Org Name:"/>
				<h:panelGroup>
					<h:inputText id="sysOrgBeanSysOrgOrgName" maxLength="300" value="#{sysOrgBean.sysOrg.orgName}"/>
					<h:message for="sysOrgBeanSysOrgOrgName" styleClass="error"/>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysOrgBeanSysOrgSysOrgSubsForOrgNo" value="Sys Org Subs For Org No:"/>
				<h:panelGroup>
					<ui:param name="_collection" value="#{sysOrgBean.sysOrg.sysOrgSubsForOrgNo}"/>
					<h:dataTable id="sysOrgBeanSysOrgSysOrgSubsForOrgNo" styleClass="data-table" value="#{forgeview:asList(_collection)}" var="_item">
						<h:column>
							<f:facet name="header">
								<h:outputText value="Sys Org By Sub Org No"/>
							</f:facet>
							<h:link outcome="/sysOrgSub/view">
								<f:param name="id" value="#{_item.id}"/>
								<h:outputText id="forgeviewdisplayitemSysOrgBySubOrgNo" value="#{forgeview:display(_item.sysOrgBySubOrgNo)}"/>
							</h:link>
							<f:facet name="footer">
								<h:selectOneMenu converter="#{sysOrgBean.converter}" id="sysOrgSubBeanAddSysOrgBySubOrgNo" value="#{sysOrgSubBean.add.sysOrgBySubOrgNo}">
									<f:selectItem/>
									<f:selectItems itemLabel="#{forgeview:display(_item)}" itemValue="#{_item}" value="#{sysOrgBean.all}" var="_item"/>
								</h:selectOneMenu>
								<h:message for="sysOrgSubBeanAddSysOrgBySubOrgNo" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Sub Org Descr"/>
							</f:facet>
							<h:link outcome="/sysOrgSub/view">
								<f:param name="id" value="#{_item.id}"/>
								<h:outputText id="itemSubOrgDescr" value="#{_item.subOrgDescr}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="sysOrgSubBeanAddSubOrgDescr" maxLength="100" value="#{sysOrgSubBean.add.subOrgDescr}"/>
								<h:message for="sysOrgSubBeanAddSubOrgDescr" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column footerClass="remove-column" headerClass="remove-column">
							<h:commandLink action="#{_collection.remove(_item)}" styleClass="remove-button"/>
							<f:facet name="footer">
								<h:commandLink action="#{_collection.add(sysOrgSubBean.added)}" id="sysOrgBeanSysOrgSysOrgSubsForOrgNoAdd" styleClass="add-button">
									<f:setPropertyActionListener target="#{sysOrgSubBean.add.sysOrgByOrgNo}" value="#{sysOrgBean.sysOrg}"/>
								</h:commandLink>
							</f:facet>
						</h:column>
					</h:dataTable>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysOrgBeanSysOrgFaJournalLines" value="Fa Journal Lines:"/>
				<h:panelGroup>
					<ui:param name="_collection" value="#{sysOrgBean.sysOrg.faJournalLines}"/>
					<h:dataTable id="sysOrgBeanSysOrgFaJournalLines" styleClass="data-table" value="#{forgeview:asList(_collection)}" var="_item">
						<h:column>
							<f:facet name="header">
								<h:outputText value="Jn Dr Amt"/>
							</f:facet>
							<h:link outcome="/faJournalLine/view">
								<f:param name="id" value="#{_item.id}"/>
								<h:outputText id="itemJnDrAmt" value="#{_item.jnDrAmt}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="faJournalLineBeanAddJnDrAmt" value="#{faJournalLineBean.add.jnDrAmt}"/>
								<h:message for="faJournalLineBeanAddJnDrAmt" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Jn Cr Amt"/>
							</f:facet>
							<h:link outcome="/faJournalLine/view">
								<f:param name="id" value="#{_item.id}"/>
								<h:outputText id="itemJnCrAmt" value="#{_item.jnCrAmt}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="faJournalLineBeanAddJnCrAmt" value="#{faJournalLineBean.add.jnCrAmt}"/>
								<h:message for="faJournalLineBeanAddJnCrAmt" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Jn Status Dr Cr"/>
							</f:facet>
							<h:link outcome="/faJournalLine/view">
								<f:param name="id" value="#{_item.id}"/>
								<h:outputText id="itemJnStatusDrCr" value="#{_item.jnStatusDrCr}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="faJournalLineBeanAddJnStatusDrCr" value="#{faJournalLineBean.add.jnStatusDrCr}"/>
								<h:message for="faJournalLineBeanAddJnStatusDrCr" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column footerClass="remove-column" headerClass="remove-column">
							<h:commandLink action="#{_collection.remove(_item)}" styleClass="remove-button"/>
							<f:facet name="footer">
								<h:commandLink action="#{_collection.add(faJournalLineBean.added)}" id="sysOrgBeanSysOrgFaJournalLinesAdd" styleClass="add-button">
									<f:setPropertyActionListener target="#{faJournalLineBean.add.sysOrg}" value="#{sysOrgBean.sysOrg}"/>
								</h:commandLink>
							</f:facet>
						</h:column>
					</h:dataTable>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysOrgBeanSysOrgFaJournals" value="Fa Journals:"/>
				<h:panelGroup>
					<ui:param name="_collection" value="#{sysOrgBean.sysOrg.faJournals}"/>
					<h:dataTable id="sysOrgBeanSysOrgFaJournals" styleClass="data-table" value="#{forgeview:asList(_collection)}" var="_item">
						<h:column>
							<f:facet name="header">
								<h:outputText value="Jn No"/>
							</f:facet>
							<h:link outcome="/faJournal/view">
								<f:param name="id" value="#{_item.jnNo}"/>
								<h:outputText id="itemJnNo" value="#{_item.jnNo}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="faJournalBeanAddJnNo" value="#{faJournalBean.add.jnNo}"/>
								<h:message for="faJournalBeanAddJnNo" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Jn Amt"/>
							</f:facet>
							<h:link outcome="/faJournal/view">
								<f:param name="id" value="#{_item.jnNo}"/>
								<h:outputText id="itemJnAmt" value="#{_item.jnAmt}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="faJournalBeanAddJnAmt" value="#{faJournalBean.add.jnAmt}"/>
								<h:message for="faJournalBeanAddJnAmt" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column footerClass="remove-column" headerClass="remove-column">
							<h:commandLink action="#{_collection.remove(_item)}" styleClass="remove-button"/>
							<f:facet name="footer">
								<h:commandLink action="#{_collection.add(faJournalBean.added)}" id="sysOrgBeanSysOrgFaJournalsAdd" styleClass="add-button">
									<f:setPropertyActionListener target="#{faJournalBean.add.sysOrg}" value="#{sysOrgBean.sysOrg}"/>
								</h:commandLink>
							</f:facet>
						</h:column>
					</h:dataTable>
				</h:panelGroup>
				<h:outputText/>
				<h:outputLabel for="sysOrgBeanSysOrgSysOrgSubsForSubOrgNo" value="Sys Org Subs For Sub Org No:"/>
				<h:panelGroup>
					<ui:param name="_collection" value="#{sysOrgBean.sysOrg.sysOrgSubsForSubOrgNo}"/>
					<h:dataTable id="sysOrgBeanSysOrgSysOrgSubsForSubOrgNo" styleClass="data-table" value="#{forgeview:asList(_collection)}" var="_item">
						<h:column>
							<f:facet name="header">
								<h:outputText value="Sys Org By Org No"/>
							</f:facet>
							<h:link outcome="/sysOrgSub/view">
								<f:param name="id" value="#{_item.id}"/>
								<h:outputText id="forgeviewdisplayitemSysOrgByOrgNo" value="#{forgeview:display(_item.sysOrgByOrgNo)}"/>
							</h:link>
							<f:facet name="footer">
								<h:selectOneMenu converter="#{sysOrgBean.converter}" id="sysOrgSubBeanAddSysOrgByOrgNo" value="#{sysOrgSubBean.add.sysOrgByOrgNo}">
									<f:selectItem/>
									<f:selectItems itemLabel="#{forgeview:display(_item)}" itemValue="#{_item}" value="#{sysOrgBean.all}" var="_item"/>
								</h:selectOneMenu>
								<h:message for="sysOrgSubBeanAddSysOrgByOrgNo" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText value="Sub Org Descr"/>
							</f:facet>
							<h:link outcome="/sysOrgSub/view">
								<f:param name="id" value="#{_item.id}"/>
								<h:outputText id="itemSubOrgDescr" value="#{_item.subOrgDescr}"/>
							</h:link>
							<f:facet name="footer">
								<h:inputText id="sysOrgSubBeanAddSubOrgDescr" maxLength="100" value="#{sysOrgSubBean.add.subOrgDescr}"/>
								<h:message for="sysOrgSubBeanAddSubOrgDescr" styleClass="error"/>
							</f:facet>
						</h:column>
						<h:column footerClass="remove-column" headerClass="remove-column">
							<h:commandLink action="#{_collection.remove(_item)}" styleClass="remove-button"/>
							<f:facet name="footer">
								<h:commandLink action="#{_collection.add(sysOrgSubBean.added)}" id="sysOrgBeanSysOrgSysOrgSubsForSubOrgNoAdd" styleClass="add-button">
									<f:setPropertyActionListener target="#{sysOrgSubBean.add.sysOrgBySubOrgNo}" value="#{sysOrgBean.sysOrg}"/>
								</h:commandLink>
							</f:facet>
						</h:column>
					</h:dataTable>
				</h:panelGroup>
				<h:outputText/>
			</h:panelGrid>

			<div class="buttons">
				<h:commandLink value="Save" action="#{sysOrgBean.update}" styleClass="btn btn-primary"/>
				<c:choose>
					<c:when test="#{!empty sysOrgBean.id}">
						<h:link value="Cancel" outcome="view" styleClass="btn btn-primary">
							<f:param name="id" value="#{sysOrgBean.id}"/>
						</h:link>
						<h:commandLink value="Delete" action="#{sysOrgBean.delete}" styleClass="btn btn-primary"/>
					</c:when>
					<c:otherwise>
						<h:link value="Cancel" outcome="search" styleClass="btn btn-primary"/>
					</c:otherwise>
				</c:choose>
			</div>
		</h:form>
	</ui:define>

</ui:composition>